﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Trie
{
    public partial class Form1 : Form
    {
        Trie trie = null;
        public Form1()
        {
            InitializeComponent();
            trie = new Trie();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            label1.Text = "";
            var node = trie.Search(textBox1.Text.ToCharArray());
            foreach (var item in node)
            {
                label1.Text += item.Word + "\r\n";
            }
        }
    }
}
